let server = process.env.NODE_ENV == 'production' ? "/kk" : "/kkdev"
let oauth = process.env.NODE_ENV == 'production' ? "/kkoauth" : "/kkoauthdev"


let appSettion = {
    projectName: 'kankan',
    url: process.env.VUE_APP_BASE_API,
    platform: server,
    oauth: server,
    saveUrl: server + "/data/save", //'/data/save',
    queryUrl: server + "/data/query", //'/data/query',
    policyUrl:server + "/data/policy", 
    upload: server + "/file/upload",
    download: server + "/file/download",
    review: server + "/file/review",
    getFlowInfo: server + "/flow/open",
    getApprovalInfo: server + "/flow/getApprovalInfo",
    processFlow: server + "/flow/processFlow",
    queryTask: server + "/flow/queryTask",
    withdrawtask: server + "/flow/withdrawtask",
    taskDiagram: server + "/flow/taskDiagram",
    openOrdernumber :server + "/flow/openOrdernumber",
}

if (window.dynamicSetting) {
    appSettion = Object.assign(appSettion, window.dynamicSetting)
}
let notUrlKey = ["projectName"]
for (let prop in appSettion) {
    if (notUrlKey.indexOf(prop) && appSettion[prop] && typeof (appSettion[prop]) == 'string' && !appSettion[prop].toLowerCase().startsWith("http"))
        appSettion[prop] = appSettion.url + appSettion[prop];
}

export default appSettion;